#include <stdio.h>
#include "mpi.h"
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>

int main(int ac, char **av){
        int num_process, myid;
        double *buf, sum;
        time_t timep;
        struct timeval tv;
        MPI_Init(&ac, &av);
        MPI_Comm_rank(MPI_COMM_WORLD, &myid);
        MPI_Comm_size(MPI_COMM_WORLD, &num_process);
        MPI_Barrier(MPI_COMM_WORLD);
        sum = myid;

        printf("%f \n", sum);
        time(&timep);
        MPI_Barrier(MPI_COMM_WORLD);
        gettimeofday(&tv, NULL);
        printf("process = %d wtime = %ld\n ",myid, tv.tv_usec);
        if(myid == 0)
                printf("barrier\n");
        MPI_Barrier(MPI_COMM_WORLD);
        MPI_Finalize();
    return 0;      
}

